import { FC, useState } from "react";
import { CompProps } from "../../types/comp";
import classNames from "classnames";
import { Modal } from "antd";

type Props = {} & CompProps;

const SearchItem: FC<Props> = ({ className, style }) => {
  const [isShow, setIsShow] = useState<boolean>(false);
  return [
    <div
      style={style}
      className={classNames(className, "mx-auto w-[150px]")}
      key="source"
    >
      <div className="h-[150px]" onClick={() => setIsShow(true)} />
      <div className="flex items-center justify-center">正常</div>
    </div>,
    <Modal
      key="modal"
      open={isShow}
      title="preview"
      footer={null}
      onCancel={() => setIsShow(false)}
    >
      <img alt="example" style={{ width: "100%" }} />
    </Modal>,
  ];
};

export default SearchItem;
